package com.lijinjiang.model;

import java.time.LocalDate;
import java.time.LocalDateTime;
/**
 * @Description 当地日期日期模型
 * @Author lijinjiang
 * @Date 2024-12-30 10:52
 */
public class LocalDateModel extends AbstractDateModel<LocalDate> {

    public LocalDateModel() {
        this(null);
    }

    public LocalDateModel(LocalDate value) {
        super();
        setValue(toLocalDateTime(value));
    }

    @Override
    protected LocalDateTime toLocalDateTime(LocalDate from) {
        return from.atStartOfDay();
    }

    @Override
    protected LocalDate fromLocalDateTime(LocalDateTime from) {
        return from.toLocalDate();
    }
}